Skip to content

Conversation

jorisvandenbossche
Copy link
Member

Addresses part of #40800, i.e. fixing the plain error when calling a ufunc that does not return string values on a string array/Series.

There are also issues with the resulting dtype (if the ufunc returns object dtype, should we infer the dtype?), but that is left for another issue (that is also less pressing than fixing the raised error)

@jorisvandenbossche jorisvandenbossche added this to the 2.3.3 milestone Sep 29, 2025
@jorisvandenbossche jorisvandenbossche added Bug Strings String extension data type and string data labels Sep 29, 2025
Comment on lines 238 to +239
else:
if self.dtype.type is str: # type: ignore[comparison-overlap]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Would be a nice if this was elif so it could be un-indented one level, but not a big deal.

@mroeschke mroeschke merged commit 52f1aec into pandas-dev:main Sep 29, 2025
42 checks passed
@mroeschke
Copy link
Member

Thanks @jorisvandenbossche

Copy link

lumberbot-app bot commented Sep 29, 2025

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 2.3.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 52f1aec9fac2f88119b5733acafcbb3efd1570a3
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #62498: BUG: avoid validation error for ufunc with string[python] array'
  1. Push to a named branch:
git push YOURFORK 2.3.x:auto-backport-of-pr-62498-on-2.3.x
  1. Create a PR against branch 2.3.x, I would have named this PR:

"Backport PR #62498 on branch 2.3.x (BUG: avoid validation error for ufunc with string[python] array)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@jorisvandenbossche
Copy link
Member Author

Manual backport -> #62505

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants